 package com.sdemo.modules.sys.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sdemo.modules.sys.mapper.RoleMapper;
import com.sdemo.modules.sys.mapper.UserMapper;
import com.sdemo.modules.sys.model.Menu;
import com.sdemo.modules.sys.model.Role;
import com.sdemo.modules.sys.model.User;
import com.sdemo.modules.sys.service.RoleService;
import com.sdemo.modules.sys.service.UserService;

@Service
public class RoleServiceImpl implements RoleService {

	@Autowired
	private RoleMapper roleMapper;

	@Override
	public List<Role> queryPageRole(Map<String, Object> parms) {
		// TODO Auto-generated method stub
		return roleMapper.queryPageRole(parms);
	}

	@Override
	public int queryCount(Map<String, Object> parms) {
		// TODO Auto-generated method stub
		return roleMapper.queryCount(parms);
	}

	@Override
	public Role queryRoleById(Long roleid) {
		// TODO Auto-generated method stub
		return roleMapper.queryRoleById(roleid);
	}

	@Override
	public int deleteRole(Long roleid) {
		// TODO Auto-generated method stub
		return roleMapper.deleteRole(roleid);
	}

	@Override
	public int insertRole(Role role) {
		// TODO Auto-generated method stub
		return roleMapper.insertRole(role);
	}

	@Override
	public List<Role> queryRoleByUserId(Long userid) {
		// TODO Auto-generated method stub
		return roleMapper.queryRoleByUserId(userid);
	}

	@Override
	public List<Role> queryAllRole() {
		// TODO Auto-generated method stub
		return roleMapper.queryAllRole();
	}

	@Override
	public List<Role> queryRoleAll(Long userid, Long roleid) {
		// TODO Auto-generated method stub
		return roleMapper.queryRoleAll(userid, roleid);
	}

	@Override
	public int insertRoleMenuBatch(List<Menu> list) {
		// TODO Auto-generated method stub
		return roleMapper.insertRoleMenuBatch(list);
	}

	@Override
	public int deleteRoleMenuByRoleId(Long roleid) {
		// TODO Auto-generated method stub
		return roleMapper.deleteRoleMenuByRoleId(roleid);
	}

	@Override
	public List<Menu> queryAuthByRoleid(Long userId) {
		// TODO Auto-generated method stub
		return roleMapper.queryAuthByRoleid(userId);
	}
	
}
